//
//  MainBackgroundModel.m
//
//  Created by Hjelm Daniel on 8/3/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "MainBackgroundModel.h"


#define CORNER_A  -3.2,  4.8,  0
#define CORNER_B   3.2,  4.8,  0
#define CORNER_C  -3.2, -4.8,  0
#define CORNER_D   3.2, -4.8,  0

@implementation MainBackgroundModel

const GLfloat squareVerticesBG[] = {
	CORNER_C,
	CORNER_D,
	CORNER_A,
	CORNER_B,
};	

#define TEX_SIDE  1

#define HEIGHT  0.234850
#define WIDTH   0.156250


const GLfloat squareTexCoordsBG[] = {
	TEX_SIDE - WIDTH, 3 * HEIGHT,
	TEX_SIDE,         3 * HEIGHT,
	TEX_SIDE - WIDTH, 2 * HEIGHT,
	TEX_SIDE,         2 * HEIGHT

};

-(void)drawModel {
	
	glVertexPointer(3, GL_FLOAT, 0, squareVerticesBG);
    glEnableClientState(GL_VERTEX_ARRAY);
    glTexCoordPointer(2, GL_FLOAT, 0, squareTexCoordsBG);
	
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    
	glEnable(GL_TEXTURE_2D);
	
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    
	glDisable(GL_TEXTURE_2D);
}

@end
